package com.bx.implatform.growUp.mapper;

import com.bx.implatform.growUp.entity.EmergencyUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DispatchMapper {
    /**
     * 获取应急队伍
     *
     * @param pageIndex
     * @param pageSize
     * @return
     */
    @Select("""
            SELECT "id", "code", "name", "organ_id", "status", "address", "age", "sex", 
                   "identity_card", "birthplace", "nation", "mobile", "height", "weight", 
                   "health_condition", "criminal_record", "specialties", "certificate", 
                   "create_time", "update_time", "category_id", "rank_id", "sequence", 
                   "team_group", "is_online", "storage_point_id", "working_way", 
                   "job_description", "duty", "daily_script", "business_capability", 
                   "initiative", "executive_force", "processization", "standardization", 
                   "computer_operating_level", "display_img_url", "additional_info", "pub_user_id"
            FROM "data_center"."emergency_user"
            ORDER BY "id" ASC
            LIMIT #{pageSize} OFFSET (#{pageIndex} - 1) * #{pageSize}
            """)
    List<EmergencyUser> emergencyUserList(Integer pageIndex, Integer pageSize);
}
